package com.dh.example.io.controller;

import com.dh.example.io.manager.SocketClientManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author yolo
 * @date 2024/3/20 16:39
 * @mail yolo_215@163.com
 */

@RestController
@RequestMapping("/")
public class TestController {

    @Resource
    private SocketClientManager socketClientManager;

    @GetMapping("/send")
    public void send(String token, String clientType, String message) {
        socketClientManager.send(token, clientType, "testEvent", message);
    }

    @GetMapping("/sendAll")
    public void sendAll(String message) {
        socketClientManager.sendAll("testEvent", message);
    }
}
